<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script type="text/javascript" src="https://cdn-hangzhou.goeasy.io/goeasy.js"></script>
    <script type="text/javascript" src="Js/jquery-1.7.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            var uuid;
            /*/myCode_goEasy*/
            $.get("/getTwoDemensionCode", function(data, status) {
                var obj = eval("(" + data + ")");
                //存储UUID
                uuid = obj.uuid;
                //显示二维码
                $("#QrCodeImg").attr("src", obj.qrCodeImg);
                //开始验证登录
                var goEasy = new GoEasy({
                    appkey:'BC-afd2c07a090549ed9661734a06ec3a26'
                });
                goEasy.subscribe({
                    channel:uuid,
                    onMessage: function(message){
                        alert(message.content);
                        window.location.href ='hello?uuid='+uuid;
                    }
                });
            });
        });


    </script>
    <title>生成二维码</title>
</head>
<body>
<div style="margin-top: 200px; margin-left: 500px;"  id="divCon">
    <img src="" id="QrCodeImg" />
    <p style="margin-left: 10px;" >请在移动端扫描二维码以登录</p>
</div>

</body>
</html>